home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / LAT-LONG.dxr / 00123_Display me for- seconds, behavior.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  1.3 KB  |  54 lines

  1. property myLocation, meSprite, out, myTimer, theDelay
  2.  
  3. on beginSprite me
  4.   set meSprite to the spriteNum of me
  5.   set myLocation to the loc of sprite the spriteNum of me
  6.   set the loc of sprite the spriteNum of me to point(900, 900)
  7.   set the cursor of sprite the spriteNum of me to [member "Pointer1", member "Pointer1 MasK"]
  8.   set out to 0
  9.   set the stageColor to the stageColor
  10. end
  11.  
  12. on endSprite me
  13.   set the cursor of sprite the spriteNum of me to 0
  14. end
  15.  
  16. on Display me
  17.   if out then
  18.     set out to 0
  19.     set the loc of sprite meSprite to point(900, 900)
  20.   else
  21.     set the loc of sprite meSprite to myLocation
  22.     set myTimer to the timer
  23.     set out to 1
  24.   end if
  25. end
  26.  
  27. on undisplay me
  28.   set the loc of sprite meSprite to point(900, 900)
  29.   set out to 0
  30. end
  31.  
  32. on enterFrame me
  33.   if out then
  34.     if (myTimer + (theDelay * 60)) < the timer then
  35.       set out to 0
  36.       set the loc of sprite meSprite to point(900, 900)
  37.     end if
  38.   end if
  39. end
  40.  
  41. on getBehaviorDescription
  42.   return "Starts with sprite me off stage (moves me on begin sprite).  Then on message display me for user defined, by property, time."
  43. end
  44.  
  45. on getPropertyDescriptionList
  46.   set descript to [:]
  47.   addProp(descript, #theDelay, [#default: 7, #format: #integer, #comment: "Display delay in seconds"])
  48.   return descript
  49. end
  50.  
  51. on mouseUp me
  52.   sendSprite(the spriteNum of me, #undisplay)
  53. end
  54.